<?php

namespace App\Http\Requests\Admin\CompanyManage;

use App\Http\Requests\Request;

class StoreRegRequest extends Request{
    public function authorize(){
        return true;
    }

    public function rules(){
        return [
            'username' => 'required|alpha_dash|isset_company_username:' . $this->uid,
            'password' => 'required',
            'email' => 'email',
            'mobile' => 'mobile_verification|unique:company_users,mobile,' . $this->uid . ',uid',
            'phone' => 'check_company_phone',
            'vip_resume_number' => 'integer',
            'vip_integral' => 'integer',
            'vip_post_number' => 'integer',
            'resume_number' => 'integer',
            'integral' => 'integer',
        ];
    }

    public function messages(){
        return [
            'username.required' => '用户名必须填写',
            'username.alpha_dash' => '用户可允许字母、数字、破折号（-）以及底线（_）',
            'username.isset_username' => '用户名以及经存在,或者手机号码和用户名相同',
            'password.required' => '密码必须填写',
            'email.email' => '请输入一个正确的邮箱！',
            'mobile.unique' => '该手机号码已存在',
            'mobile.mobile_verification' => '请输入一个正确的手机号码！',
            'phone.check_company_phone' => '请输入一个正确的电话号码！',
            'vip_resume_number.integer' => '会员期内简历数必须是整数！',
            'vip_integral.integer' => '会员期内积分必须是整数！',
            'vip_post_number.integer' => '会员期内职位数必须是整数！',
            'resume_number.integer' => '简历数必须是整数！',
            'integral.integer' => '积分必须是整数！',
        ];
    }
}
